package com.hbk.param;

import lombok.Data;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;

public class NewsParam {

    @Data
    public static class AddParam{
        @NotNull
        private String title;
        @NotNull
        private String summary;
        @NotNull
        private Integer type;
        @NotNull
        private String content;
        private Integer orderNum;
        private String publishTime;
    }

    @Data
    public static class ModifyParam{
        @NotNull
        private String newsId;
        @NotNull
        private String title;
        @NotNull
        private String summary;
        @NotNull
        private Integer type;
        @NotNull
        private String content;
        private Integer orderNum;
        private String publishTime;
    }

    @Data
    public static class ListParam{
        @NotNull
        private Integer start;
        @NotNull
        private Integer num;
        private String title;
        private Integer state;
        private Integer type;
    }

    @Data
    public class GetParam {
        @NotNull
        private String newsId;
    }

    @Data
    public class PublishParam {
        @NotNull
        private String newsId;
    }

    @Data
    public class CancelParam{
        @NotNull
        private String newsId;
    }

    @Data
    public class DeleteParam {
        @NotNull
        private String newsId;
    }

    @Data
    public class CommandOrderNumParam{
        private String newsId;
        private Integer orderNum;
    }

    @Data
    public static class WebListParam{
        private Integer page;
        private Integer num;
        @NotNull
        private Integer type;
    }

    @Data
    public static class GetOtherParam {
        private String contentId;
    }

    @Data
    public static class ModifyOtherParam {
        private String contentId;
        private String content;
        private List<AttachParam> attachList = new ArrayList<>();
    }

    @Data
    public static class AttachParam{
        private String name;
        private String url;
    }


    @Data
    public static class PageListParam {
        @NotNull
        private Integer start;
        @NotNull
        private Integer num;
        @NotNull
        private Integer type;
    }


}
